package cn.gson.springboot.common;

import java.io.IOException;
import java.util.Set;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class MyFunctionTag extends SimpleTagSupport{
	private int funId;
	
	@Override
	public void doTag() throws JspException, IOException {
		super.doTag();
		//获得session中的用户的功能列表
		PageContext pc = (PageContext) this.getJspContext();
		Set<Integer> set= (Set<Integer>) pc.getSession().getAttribute("yonghu");
	
		for (Integer id : set) {
			if(id == funId) {
				this.getJspBody().invoke(null);
			}
		}
	}

	public int getFunId() {
		return funId;
	}

	public void setFunId(int funId) {
		this.funId = funId;
	}
	
}
